<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
function addstorage()
{
	$('#addstorageform').modal('show');	
}
function edit(id,t)
{
$.post("/product/ajaxbutton", {"op": "edit","id":id,"st":t},
  function(data){
		if(data)
		{
			$("#id").val(data.id);
			$("#name").val(data.storagename);
			$("#paixu").val(data.paixu);
            $("#is_show").val(data.is_show);
			$('#addstorageform').modal('show');
		}
		
	return;
   },"json");	
}
</script>
<title>仓库设置</title>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">仓库设置</h1>
      <span class="pagedesc">
      <div class="menulist">
        <ul class="profile_summary">
          <li> <a href="javascript:void(0)" onClick="addstorage()" class=""><span>添加仓库</span></a></li>
        </ul>
      </div>
      </span>
      <div class="menulist">
        <ul class="profile_summary">
          <li class="current"></li>
        </ul>
      </div>
    </div>
    <!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
        <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
          <thead>
            <tr>
              <th class="head1">名称</th>
              <th class="head1">商品名</th>
            </tr>
          </thead>
          <tbody>
          
          {{foreach from=$storagelist item=res key=key}}
          <tr>
            <td class="head1">{{$res.storagename}}</td>
            <td class="head0"><a href="javascript:void(0)" onClick="edit({{$res.id}},'editstorage')">编辑</a>｜<a href="javascript:void(0)" onClick="delone({{$res.id}},'delstorage')">移除</a></td>
          </tr>
         
          {{/foreach}}
            </tbody>
          
        </table>
        <br />
      </div>
      <!--subcontent--> 
      
      <!--subcontent--> 
      
    </div>
    <!--contentwrapper--> 
    
  </div>
  <!-- centercontent --> 
  
</div>

<!-- 模态框（Modal）添加商品属性 -->
<form action="/product/ajaxbutton?op=savestorage"  method="post" name="attributeform" id="attributeform" >
<input type="hidden" id="id" name="id" value="0">
  <div class="modal fade" id="addstorageform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform"> 添加仓库 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>名称： </td>
              <td align="left"><input type="text" name="name" id="name" required class="width200"  placeholder="仓库名称" /></td>
            </tr>
            
            <tr>
              <td>排序： </td>
              <td align="left"><input type="text" name="paixu" id="paixu" class="width50" onKeyUp="this.value=this.value.replace(/[^1-9]/g,'');" placeholder="倒序" /></td>
            </tr>
            <tr>
              <td>是否显示： </td>
              <td align="left">
                <select name="is_show" id="is_show" style="width: 100px;">
                  <option value="1">显示</option>
                  <option value="0">不显示</option>
                </select>
              </td>
            </tr>
             <tr>
              <td>注意： </td>
              <td align="left" style="color:red;">仓库的设立影响到商品的库存管理。请认真对待！</td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('attributeform','addstorageform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
</form>
</body>
</html>